# yacc makefile
# the environment variable 'mumps' needs to point to the folder containing MUMPS installation

yaccdir = $(PWD)
topdir = $(mumps)
libdir = $(topdir)/lib

include $(topdir)/Makefile.inc

LIBMUMPS_COMMON = $(libdir)/libmumps_common$(PLAT)$(LIBEXT)

LIBDMUMPS = $(libdir)/libdmumps$(PLAT)$(LIBEXT) $(LIBMUMPS_COMMON)

.PHONY: yacc.hgstamp

yacc: $(LIBDMUMPS) yacc.hgstamp
	$(FC) $(OPTF) $(INCS) -I. -I$(topdir)/include \
	$(yaccdir)/share.f90 $(yaccdir)/domain.f90 $(yaccdir)/markeraux.f90 $(yaccdir)/linsolver.f90 \
	$(yaccdir)/flow.f90 $(yaccdir)/iniconds.f90 $(yaccdir)/energy.f90 $(yaccdir)/main.f90 \
	-o yacc $(LIBDMUMPS) $(LORDERINGS) $(LIBS) $(LIBBLAS) $(LIBOTHERS)

clean:
	rm -f yacc *.mod yacc.hgstamp

yacc.hgstamp:
	@[ -f $@ ] || touch $@
	@hg parents --template 'hgid: {node|short}\ndate: {date|isodate}\nauth: {author}\n' > $@
